Skip to content

Comments

bank_table: add max-preempt-after column#556

Open
cmoussa1 wants to merge 4 commits intoflux-framework:masterfrom
cmoussa1:issue#553
Open

bank_table: add max-preempt-after column#556
cmoussa1 wants to merge 4 commits intoflux-framework:masterfrom
cmoussa1:issue#553

Conversation

@cmoussa1
Copy link
Member

Problem

The bank_table does not have a way to track a max preemptible-after value for a certain bank. This kind of information is needed to enforce a limit on association-set preemptible-after values on their jobs as well as set a default on their job in the case where the association does not set one on their own.


This PR begins to add support for enforcing preemptible-after limits on a per-bank basis by adding a new column to the bank_table called max_preempt_after, which is a floating point number representing the max number of seconds in which a job submitted under this bank can run before being preempted. It does not require a value and does not have a default value.

--max-preempt-after optional arguments are also added to the add-bank and edit-bank commands to allow an admin to both define and change the max-preempt-after attribute for a bank. The expected format for this attribute in both the add-bank and edit-bank commands is Flux Standard Duration (FSD). A bank's max-preempt-after can also be cleared by passing -1 as a value if the admin no longer wants to have a max preemptible-after attribute defined for a particular bank.

I've added some basic tests to a new test file that adds multiple banks with different FSD values as well as resets its value after setting a value initially.

Fixes #553

@cmoussa1 cmoussa1 added new feature new feature database related to the flux-accounting database labels Dec 19, 2024
@cmoussa1
Copy link
Member Author

@ryanday36 when you have some time, could you give this a look and let me know if this looks like something you'd be good with in terms of managing banks in the flux-accounting database? Note that this doesn't actually enforce the limit in the priority plugin (yet); it's just the first part in being able to define and set this limit in the DB.

@cmoussa1 cmoussa1 requested a review from ryanday36 December 19, 2024 20:24
@cmoussa1 cmoussa1 force-pushed the issue#553 branch 2 times, most recently from 9debb7a to 9f85ca7 Compare February 19, 2025 19:17
@cmoussa1 cmoussa1 force-pushed the issue#553 branch 2 times, most recently from 7c89ae1 to a6a3de5 Compare May 6, 2025 21:52
@cmoussa1 cmoussa1 force-pushed the issue#553 branch 2 times, most recently from 02ac4d2 to 3deb9e0 Compare May 29, 2025 18:37
cmoussa1 added 4 commits July 1, 2025 10:32
Problem: The bank_table does not have a way to track a max
preemptible-after value for a certain bank. This kind of information is
needed to enforce a limit on association-set preemptible-after values on
their jobs as well as set a default on their job in the case where the
association does not set one on their own.

Add a new column to the bank_table called "max_preempt_after", which
is a floating point number representing the max number of seconds in
which a job submitted under this bank can run before being preempted.
It does not require a value and does not have a default.

Update the schema version number of the flux-accounting database to
account for the change to bank_table.

Add "max_preempt_after" to the list of column names defined in the
BANK_TABLE constant in __init__.py.
Problem: The add-bank and edit-bank commands have no way to specify a
max-preempt-after value for a bank when it is being added to the
bank_table.

Add a new optional argument to the add-bank and edit-bank commands:
--max-preempt-after, which takes a Flux Standard Duration (FSD) value
representing the max amount of time in which a job submitted under this
bank can run before being preempted.

The max-preempt-after attribute for a bank can also be cleared by
passing -1 to the --max-preempt-after optional argument in the
edit-bank command.
Problem: There are a number of tests that check the output of the
view-bank commands that are now out-of-date because of the addition of
the max-preempt-after column.

Edit the expected output for a number of files in the flux-accounting
testsuite to account for the addition of the max-preempt-after column.
Problem: There are no tests for adding/editing banks in the bank_table
with max-preempt-after values.

Add some tests.
@codecov
Copy link

codecov bot commented Jul 1, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 84.11%. Comparing base (79ee20e) to head (0f923ff).
Report is 3 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #556   +/-   ##
=======================================
  Coverage   84.11%   84.11%           
=======================================
  Files          26       26           
  Lines        2185     2185           
=======================================
  Hits         1838     1838           
  Misses        347      347           
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

database related to the flux-accounting database new feature new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bank_table: add max-preemptible-after column

1 participant